package com.lion.ball.modules.orderfood.service.assistants.converters;

import java.sql.Timestamp;
import com.lion.common.base.utils.ConvertUtil;
import com.lion.common.base.utils.DbUtil;
import com.lion.common.spring.annotations.DataConverter;
import com.lion.common.spring.business.base.BaseConverter;
import com.lion.utils.TimeUtil;
import com.lion.ball.modules.orderfood.domain.entity.OfdDynamicGroupFoodEntity;
import com.lion.ball.modules.orderfood.web.model.params.create.OfdDynamicGroupFoodCreateParam;
import com.lion.ball.modules.orderfood.web.model.params.update.OfdDynamicGroupFoodUpdateParam;
import com.lion.ball.modules.orderfood.web.model.results.OfdDynamicGroupFoodResult;

/**
 * @author Chris Chan
 * Create on 2025-10-18 13:33
 * Use for: 动态分组与食品关联 业务数据转换助手
 * Explain:
 * 
 */
@DataConverter
public class OfdDynamicGroupFoodConverter implements BaseConverter<
        OfdDynamicGroupFoodEntity,
        OfdDynamicGroupFoodCreateParam,
        OfdDynamicGroupFoodUpdateParam,
        OfdDynamicGroupFoodResult> {
    @Override
    public OfdDynamicGroupFoodEntity fromParam(OfdDynamicGroupFoodCreateParam param) {
        OfdDynamicGroupFoodEntity entity = new OfdDynamicGroupFoodEntity();
        ConvertUtil.copyProperties(param, entity, "id");
        return entity;
    }

    @Override
    public OfdDynamicGroupFoodEntity fromUpdateParam(OfdDynamicGroupFoodUpdateParam param) {
        OfdDynamicGroupFoodEntity entity = ConvertUtil.convert(param, OfdDynamicGroupFoodEntity.class);
        return entity;
    }

    @Override
    public OfdDynamicGroupFoodResult toResult(OfdDynamicGroupFoodEntity entity) {
        OfdDynamicGroupFoodResult result = ConvertUtil.convert(entity,OfdDynamicGroupFoodResult.class);
        return result;
    }
}